package Server.TechnicalServices.Mapper;

import Server.Entity.Dominio.EMoney;
import Server.Entity.IceClasses.EMoneyI;

public class MMoney implements Mapper{

	@Override
	public EMoneyI getIceObj(Object hibObj) {

		EMoneyI iceMoney = null;
		
		if ( hibObj instanceof EMoney)
		{
			iceMoney = new EMoneyI();
			
			iceMoney.id = ((EMoney) hibObj).getId();
			iceMoney.prezzo = ((EMoney) hibObj).getPrezzo();
			iceMoney.valuta = ((EMoney) hibObj).getValuta();
		}
		
		return iceMoney;
	}

	@Override
	public EMoney getHibObj(Object iceObj) {

		EMoney hibMoney = null;
		
		if ( iceObj instanceof EMoneyI)
		{
			hibMoney = new EMoney();
			
			hibMoney.setId(((EMoneyI) iceObj).id);
			hibMoney.setPrezzo(((EMoneyI) iceObj).prezzo);
			hibMoney.setValuta(((EMoneyI) iceObj).valuta);
		}
		
		return hibMoney;
		
	}
	
}
